home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-20 | 3.0 KB | 102 lines | [TEXT/CWIE] |
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Change History
- //
- // 961105 MMF added constants for RGB_GRAY through OLORREF_BROWN. Seems
- // like these were taken out in the label control, but we'd
- // like to use a common set between the Label and the Ticker,
- // I added them back in.
- //
-
- #ifndef _Colors_h_
- #define _Colors_h_
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Initialize colors
- //
- extern const RGBColor RGB_WHITE;
- extern const RGBColor RGB_BLACK;
- extern const RGBColor RGB_YELLOW;
- extern const RGBColor RGB_MAGENTA;
- extern const RGBColor RGB_RED;
- extern const RGBColor RGB_CYAN;
- extern const RGBColor RGB_GREEN;
- extern const RGBColor RGB_BLUE;
-
- extern const RGBColor RGB_GRAY;
- extern const RGBColor RGB_LTGRAY;
- extern const RGBColor RGB_BROWN;
-
- extern const RGBColor COLORREF_RED;
- extern const RGBColor COLORREF_GREEN;
- extern const RGBColor COLORREF_BLUE;
- extern const RGBColor COLORREF_MAGENTA;
- extern const RGBColor COLORREF_CYAN;
- extern const RGBColor COLORREF_BLACK;
- extern const RGBColor COLORREF_YELLOW;
- extern const RGBColor COLORREF_WHITE;
-
- extern const RGBColor COLORREF_LTRED;
- extern const RGBColor COLORREF_LTGREEN;
- extern const RGBColor COLORREF_LTBLUE;
- extern const RGBColor COLORREF_LTMAGENTA;
- extern const RGBColor COLORREF_LTCYAN;
-
- extern const RGBColor COLORREF_GRAY;
- extern const RGBColor COLORREF_LTGRAY;
- extern const RGBColor COLORREF_BROWN;
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Structures
- //
- typedef struct tagCOLORREF
- {
- unsigned char red;
- unsigned char green;
- unsigned char blue;
- } COLORREF;
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // macros
- //
- #define MAX_UBYTE 0xFF
- #define MAX_USHORT 0xFFFF
- #define CONVERSION (MAX_USHORT / MAX_UBYTE)
-
- #define ABSVAL(x) ((x)>0?(x):(-(x)))
-
- #define COLOR_EQ(x,y) (((x).red==(y).red) && ((x).green==(y).green) && ((x).blue==(y).blue))
- #define SET_COLOR(x,y) { (x).red = (y)->red; (x).green = (y)->green; (x).blue = (y)->blue; }
-
- #define RGBDELTA(x,y) ( ( ABSVAL((x)->red - (y)->red) + \
- ABSVAL((x)->green - (y)->green) + \
- ABSVAL((x)->blue - (y)->blue) ) / 3 )
-
- #define MIN3(x,y,z) (((x)<(y)?(x):(y))<(z)?((x)<(y)?(x):(y)):(z))
-
-
-
- ///////////////////////////////////////////////////////////////////////////////
- //
- // Function Prototypes
- //
-
- void MapColorRefToRGBColor(const COLORREF * desiredColorRef, RGBColor * desiredRGBColor, Boolean useColorMatching = true);
-
- void MatchColor (
- const RGBColor * targetColor,
- const RGBColor ** colorPtrArray,
- short arraySize,
- unsigned long & delta,
- short & index);
-
- Boolean RGBColorsEQ( const RGBColor & color1, const RGBColor & color2 );
- RGBColor RGBColorsPERCENT(const RGBColor color, const double percent);
- RGBColor RGBColorsPLUS(const RGBColor color1, const RGBColor color2);
- RGBColor RGBColorsInterpolate(const RGBColor color1, const RGBColor color2, double percent);
-
-
- #endif // _Colors_h_